//
//  OSL_Then_DemoVC.swift
//  APSwift
//
//  Created by jianbo.pei on 2023/7/3.
//

import UIKit
import Then

class OSL_Then_DemoVC: UIViewController {

    private var hahaLabel: UILabel?
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        test1()
        test2()
    }
    
    func test1() {
        hahaLabel = UILabel().then { make in
            view.addSubview(make)
        }.then { make in
            make.text = "哈哈哈"
            make.frame = CGRect(x: 20, y: 200, width: 300, height: 50)
        }
            
    }
    
    func test2() {
        let frame1 = CGRect(x: 10, y: 100, width: 200, height: 40)
        let frame2 = frame1.with { frame in
            frame.size.width = 300
            frame.size.height = 60
        }
        debugPrint("1234 11 --- frame1 is \(frame1)")
        debugPrint("1234 11 --- frame2 is \(frame2)")
        
//        var lb1 = hahaLabel
//        debugPrint("1234 11 --- lb1 is \(lb1), \(String(describing: lb1?.text))")
//        debugPrint("1234 11 --- lb1 is \(hahaLabel), \(String(describing: hahaLabel?.text))")
//        let lb2 = lb1?.with { lb in
//            lb.text = "222"
//        }
////        lb1 = nil
//        debugPrint("1234 22 --- lb1 is \(lb1), \(String(describing: lb1?.text))")
//        debugPrint("1234 22 --- lb1 is \(hahaLabel), \(String(describing: hahaLabel?.text))")
//        debugPrint("1234 --- lb2 is \(lb2), \(String(describing: lb2?.text))")
//        debugPrint("1234")
    }
}
